import router from './router'
import store from './store'

router.beforeEach((to, from, next) => {
  // 如果是访问账户管理相关页面
  if (to.path.includes('/Account-manage')) {
    // 显示账户管理菜单
    store.dispatch('permission/toggleAccountManage', true)
  } else {
    // 其他页面隐藏账户管理菜单
    store.dispatch('permission/toggleAccountManage', false)
  }
  next()
})
